# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
from __future__ import annotations

from typing import MutableMapping, MutableSequence

import proto  # type: ignore

__protobuf__ = proto.module(
    package="google.shopping.merchant.accounts.v1",
    manifest={
        "DeveloperRegistration",
        "RegisterGcpRequest",
        "UnregisterGcpRequest",
        "GetDeveloperRegistrationRequest",
        "GetAccountForGcpRegistrationResponse",
    },
)


class DeveloperRegistration(proto.Message):
    r"""Represents a developer registration owned by a Merchant
    account.

    Attributes:
        name (str):
            Identifier. The ``name`` (ID) of the developer registration.
            Generated by the Content API upon creation of a new
            ``DeveloperRegistration``. The ``account`` represents the
            merchant ID of the merchant that owns the registration.
        gcp_ids (MutableSequence[str]):
            Output only. The GCP ids attached to this
            developer registration
    """

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )
    gcp_ids: MutableSequence[str] = proto.RepeatedField(
        proto.STRING,
        number=2,
    )


class RegisterGcpRequest(proto.Message):
    r"""Request message for the RegisterGCP method.

    Attributes:
        name (str):
            Required. The name of the developer registration to be
            created for the merchant account that the GCP will be
            registered with. Format:
            ``accounts/{account}/developerRegistration``
        developer_email (str):
            Immutable. If the developer email provided is
            associated with a user in the merchant account
            provided, the user will be updated to have "API
            developer" access type and the email preference
            corresponding to that user will be updated to
            have the new "API notifications" preference. If
            the developer email provided is not associated
            with any user we will just add it as a contact.
            The email preference corresponding to that
            contact will have the new "API notifications"
            preference. Make sure the email used is
            associated with a Google Account (Google
            Workspace account or Gmail account) and is not a
            service account as service accounts can't
            receive emails.
    """

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )
    developer_email: str = proto.Field(
        proto.STRING,
        number=2,
    )


class UnregisterGcpRequest(proto.Message):
    r"""Request message for the UnregisterGCP method.

    Attributes:
        name (str):
            Required. The name of the developer registration to be
            created for the merchant account that the GCP will be
            registered with. Format:
            ``accounts/{account}/developerRegistration``
    """

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )


class GetDeveloperRegistrationRequest(proto.Message):
    r"""Request message for the GetDeveloperRegistration method.

    Attributes:
        name (str):
            Required. The ``name`` (ID) of the developer registration.
    """

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )


class GetAccountForGcpRegistrationResponse(proto.Message):
    r"""Response message for the GetAccountForGcpRegistration method.

    Attributes:
        name (str):
            The name of the merchant account id that the
            GCP is registered with.
    """

    name: str = proto.Field(
        proto.STRING,
        number=1,
    )


__all__ = tuple(sorted(__protobuf__.manifest))
